<template>
	<view class="w-100">
		<view class="leson-popup" @click="close" v-if="showPopup" @touchmove.stop.prevent>
			<view class="bottom-slot flex-1 bg-white animate__animated animate__fadeInUp" @click.stop.prevent="">
				<view class="flex-1">
					<slot />
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				showPopup: false
			}
		},
		onLoad(options) {

		},
		props: {
			popupStatu: {
				type: Boolean,
				default: false
			},
		},
		watch: {
			popupStatu(newVal) {
				if (newVal == true) {
					this.showPopup = true
				}
			}
		},
		methods: {
			close() {
				if (this.showPopup) {
					this.showPopup = false
				}
				this.$emit('statusChanged', this.showPopup);
			},
			open() {
				this.showPopup = true
			}

		}
	}
</script>
<style scoped>
	.leson-popup {
		position: fixed;
		top: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.7);
		z-index: 99;
	}

	.bottom-slot {
		position: absolute;
		right: 0;
		left: 0;
		bottom: 0;
		animation-duration: .3s;
		z-index: 100;
		border-radius: 18rpx 18rpx 0 0;
	}
</style>